<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2019/5/28 0028
 * Time: 下午 3:02
 */

namespace app\sports_admin\vaildate;


class ConstitutionProject extends Base
{
    protected $rule = [
        'id'=>'require|isPositiveInteger',
    ];

    protected $message = [
        'id'=>'编号必须为整数',
    ];
    //添加
    public function insert()
    {
        $rule = [
            'year'=>'require|integer',
            'type_id'=>'require|integer',
            'grade_id'=>'require|integer',
            'sex'=>'require|integer',
            'LearnTRLastIndex'=>'require|integer'
        ];
        $msg = [
            'year'=>'年份格式错误',
            'type_id'=>'类别各式错误',
            'grade_id'=>'年级格式错误',
            'sex'=>'性别格式错误',
            'LearnTRLastIndex'=>'序号格式错误'
        ];
        self::goCheck($rule,$msg);
    }
    //删除
    public function delete()
    {
        $rule = [
            'type_id'=>'require|integer',
            'grade_id'=>'require|integer',
        ];
        $msg = [
            'type_id'=>'类别各式错误',
            'grade_id'=>'年级格式错误',
        ];
        self::goCheck($rule,$msg);
    }
    //修改
    public function update()
    {
        $rule = [
            'year'=>'require|integer',
            'old_year'=>'require|integer',
            'type_id'=>'require|integer',
            'old_type_id'=>'require|integer',
            'grade_id'=>'require|integer',
            'old_grade_id'=>'require|integer',
            'sex'=>'require|integer',
            'old_sex'=>'require|integer',
            'LearnTRLastIndex'=>'require|integer'
        ];
        $msg = [
            'year'=>'年份格式错误',
            'old_year'=>'年份格式错误',
            'type_id'=>'类别各式错误',
            'old_type_id'=>'类别各式错误',
            'grade_id'=>'年级格式错误',
            'old_grade_id'=>'年级格式错误',
            'sex'=>'性别格式错误',
            'old_sex'=>'性别格式错误',
            'LearnTRLastIndex'=>'序号格式错误'
        ];
        self::goCheck($rule,$msg);
    }
}